package com.hytc.mymall.frgament;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;

import com.hytc.mymall.R;
import com.hytc.mymall.base.BaseFragment;

/**
 * Created by allkiss on 2016/12/9
 */

public class PublicWelfareMerchantFragment extends BaseFragment implements  AdapterView.OnItemClickListener {

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.activity_consumptionseries,null);
    }

    @Override
    public void initView(View p0) {

    }
//    private static final int ARROUND_SEARCH_TYPE = 2;
//    private static final int LOCAL_SEARCH_TYPE = 1;
//    private static final String WHOLE_CITY = "\u5168\u57ce";
//    private final int CITY_CHOOSE_REQUEST_CODE;
//    private int currentPage;
//    private List<View> dollList;
//    private LinearLayout dots_ll;
//    private long exitTime;
//    private List<GridView> gridviewList;
//    private String localCity;
//    private CloudItemListAdapter mAdapter;
//    private Context mApplicationContext;
//    private LinearLayout mBtnAreaChoose;
//    private ImageView mBtnMap;
//    private LatLonPoint mCenterPoint;
//    private int mChosenDistrictIndex;
//    private ArrayList<String> mCityLetterList;
//    private ArrayList<City> mCityList;
//    private HashMap<String, Integer> mCityMap;
//    private CloudSearch mCloudSearch;
//    private ArrayList<CloudItem> mCoudItemList;
//    private String mCurrentCity;
//    private TextView mCurrentCityDistrictTextview;
//    private String mCurrentDistrict;
//    private int mCurrentPageNum;
//    private int mCurrentSearchType;
//    private String[] mDistrictsOfCurrentCity;
//    private HashMap<String, String[]> mDistrictsOfcityMap;
//    private int mFirstVisibleItem;
//    private AdapterView$OnItemClickListener mGridViewItemListener;
//    private String mKeywords;
//    private LinearLayout mLLYNoData;
//    private String[] mLetterStrs;
//    private AMapLocationClient mLocationClient;
//    private AMapLocationClientOption mLocationOption;
//    private String mMerchantType;
//    private CityChoosePopupWindow mPopupWindow;
//    private View$OnClickListener mPopupWindowClickListener;
//    private Dialog mProgressDialog;
//    private PullToRefreshListView mPullRefreshListView;
//    private Query mQuery;
//    private RelativeLayout mSearchBarLinearLayout;
//    private ImageView mUpDownArrow;
//    private int mVisibleItemCount;
//    private EditText minputEditText;
//    private List<Integer> picUrlList;
//    private SelectPop pop;
//    private List<String> stringList;
//    private String tableID;
//    private String[] titles;
//    private int usertype;
//
//    public PublicWelfareMerchantFragment() {
//        this.tableID = "57105167305a2a6ea6690d7f";
//        this.CITY_CHOOSE_REQUEST_CODE = 10;
//        this.mLocationClient = null;
//        this.mLocationOption = null;
//        this.mLetterStrs = new String[] { "\u5e38", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
//        this.mCenterPoint = new LatLonPoint(39.911823, 116.394829);
//        this.mKeywords = "";
//        this.mCoudItemList = new ArrayList<CloudItem>();
//        this.mProgressDialog = null;
//        this.mCurrentPageNum = 0;
//        this.mCurrentSearchType = 2;
//        this.mMerchantType = "";
//        this.localCity = "";
//        this.currentPage = 0;
//        this.mPopupWindowClickListener = (View$OnClickListener)new View$OnClickListener() {
//            public void onClick(final View view) {
//                switch (view.getId()) {
//                    default: {}
//                    case 2131100463: {
//                        PublicWelfareMerchantFragment.this.gotoCityListActivity();
//                        PublicWelfareMerchantFragment.this.mPopupWindow.dismiss();
//                    }
//                }
//            }
//        };
//        this.mGridViewItemListener = (AdapterView$OnItemClickListener)new AdapterView$OnItemClickListener() {
//            public void onItemClick(final AdapterView<?> adapterView, final View view, final int n, final long n2) {
//                PublicWelfareMerchantFragment.access$2(PublicWelfareMerchantFragment.this, n);
//                PublicWelfareMerchantFragment.access$4(PublicWelfareMerchantFragment.this, PublicWelfareMerchantFragment.this.mDistrictsOfCurrentCity[n]);
//                PublicWelfareMerchantFragment.this.mCurrentCityDistrictTextview.setText((CharSequence)(String.valueOf(PublicWelfareMerchantFragment.this.getCurrentCity()) + PublicWelfareMerchantFragment.this.mCurrentDistrict));
//                PublicWelfareMerchantFragment.this.mCoudItemList.clear();
//                PublicWelfareMerchantFragment.this.mAdapter.notifyDataSetChanged();
//                PublicWelfareMerchantFragment.this.searchByLocal(0);
//                PublicWelfareMerchantFragment.this.mPopupWindow.dismiss();
//            }
//        };
//        this.mChosenDistrictIndex = -1;
//        this.exitTime = 0L;
//        this.mDistrictsOfcityMap = new HashMap<String, String[]>();
//        this.dollList = new ArrayList<View>();
//        this.picUrlList = new ArrayList<Integer>();
//    }
//
//    static /* synthetic */ void access$11(final PublicWelfareMerchantFragment publicWelfareMerchantFragment, final String mMerchantType) {
//        publicWelfareMerchantFragment.mMerchantType = mMerchantType;
//    }
//
//    static /* synthetic */ void access$12(final PublicWelfareMerchantFragment publicWelfareMerchantFragment, final String tableID) {
//        publicWelfareMerchantFragment.tableID = tableID;
//    }
//
//    static /* synthetic */ void access$17(final PublicWelfareMerchantFragment publicWelfareMerchantFragment, final int currentPage) {
//        publicWelfareMerchantFragment.currentPage = currentPage;
//    }
//
//    static /* synthetic */ void access$2(final PublicWelfareMerchantFragment publicWelfareMerchantFragment, final int mChosenDistrictIndex) {
//        publicWelfareMerchantFragment.mChosenDistrictIndex = mChosenDistrictIndex;
//    }
//
//    static /* synthetic */ void access$20(final PublicWelfareMerchantFragment publicWelfareMerchantFragment, final int mCurrentPageNum) {
//        publicWelfareMerchantFragment.mCurrentPageNum = mCurrentPageNum;
//    }
//
//    static /* synthetic */ void access$21(final PublicWelfareMerchantFragment publicWelfareMerchantFragment, final int mCurrentSearchType) {
//        publicWelfareMerchantFragment.mCurrentSearchType = mCurrentSearchType;
//    }
//
//    static /* synthetic */ void access$4(final PublicWelfareMerchantFragment publicWelfareMerchantFragment, final String mCurrentDistrict) {
//        publicWelfareMerchantFragment.mCurrentDistrict = mCurrentDistrict;
//    }
//
//    private void createCityListForCityChoose() {
//        try {
//            this.dealWithJson(Utils.getAssetsFie((Context)this.getActivity(), "city.json"));
//        }
//        catch (IOException ex) {
//            Log.e("aaa", "city init failed", (Throwable)ex);
//        }
//    }
//
//    private void dealWithJson(final String s) {
//        while (true) {
//            while (true) {
//                int n = 0;
//                Label_0297: {
//                    try {
//                        final JSONObject jsonObject = new JSONObject(s);
//                        if ("200".equals(jsonObject.getString("status"))) {
//                            final JSONObject jsonObject2 = jsonObject.getJSONObject("result");
//                            jsonObject2.optInt("version");
//                            final JSONObject jsonObject3 = jsonObject2.getJSONObject("city");
//                            final HashMap<String, Integer> mCityMap = new HashMap<String, Integer>();
//                            final ArrayList<String> mCityLetterList = new ArrayList<String>();
//                            final ArrayList<City> mCityList = new ArrayList<City>();
//                            n = 0;
//                            if (n >= this.mLetterStrs.length) {
//                                if (this.mCityList == null || this.mCityList.size() <= 0) {
//                                    this.mCityList = mCityList;
//                                    this.mCityMap = mCityMap;
//                                    this.mCityLetterList = mCityLetterList;
//                                    return;
//                                }
//                            }
//                            else {
//                                final String letter = this.mLetterStrs[n];
//                                final JSONArray optJSONArray = jsonObject3.optJSONArray(letter);
//                                if (optJSONArray == null) {
//                                    break Label_0297;
//                                }
//                                mCityLetterList.add(letter);
//                                for (int i = 0; i < optJSONArray.length(); ++i) {
//                                    final JSONObject jsonObject4 = optJSONArray.getJSONObject(i);
//                                    final City city = new City();
//                                    city.name = jsonObject4.optString("name");
//                                    city.code = jsonObject4.optString("cityCode");
//                                    if (i == 0) {
//                                        mCityMap.put((String)(city.letter = letter), mCityList.size());
//                                    }
//                                    mCityList.add(city);
//                                }
//                                break Label_0297;
//                            }
//                        }
//                        else if (this.mCityList == null || this.mCityList.size() <= 0) {
//                            this.showErrorDialog(this.getString(2131362167));
//                            return;
//                        }
//                    }
//                    catch (JSONException ex) {
//                        ex.printStackTrace();
//                    }
//                    break;
//                }
//                ++n;
//                continue;
//            }
//        }
//    }
//
//    private void dissmissProgressDialog() {
//        if (this.mProgressDialog != null && this.mProgressDialog.isShowing()) {
//            this.mProgressDialog.dismiss();
//        }
//    }
//
//    private void firstDot(int n) {
//        this.dots_ll.removeAllViews();
//        this.dollList.clear();
//        if (n != 1) {
//            if (n > 4) {
//                n = 4;
//            }
//            for (int i = 0; i < n; ++i) {
//                final View view = new View((Context)this.getActivity());
//                final LinearLayout$LayoutParams linearLayout$LayoutParams = new LinearLayout$LayoutParams(BaseTools.dip2px((Context)this.getActivity(), 6.0f), BaseTools.dip2px((Context)this.getActivity(), 6.0f));
//                linearLayout$LayoutParams.setMargins(5, 0, 5, 0);
//                if (i == 0) {
//                    view.setBackgroundResource(2130837787);
//                }
//                else {
//                    view.setBackgroundResource(2130837603);
//                }
//                this.dots_ll.addView(view, (ViewGroup$LayoutParams)linearLayout$LayoutParams);
//                this.dollList.add(view);
//            }
//        }
//    }
//
//    private String[] getDistrictsBasedonCityName(final String s) {
//        if (this.mDistrictsOfcityMap.containsKey(s)) {
//            return this.mDistrictsOfcityMap.get(s);
//        }
//        final List<String> itsDistricts = new CityUtil((Context)this.getActivity(), s).getItsDistricts();
//        final String[] array = itsDistricts.toArray(new String[itsDistricts.size()]);
//        this.mDistrictsOfcityMap.put(s, array);
//        return array;
//    }
//
//    private void gotoCityListActivity() {
//        final Intent intent = new Intent((Context)this.getActivity(), (Class)CityListActivity.class);
//        intent.putExtra("city_list", (Serializable)this.mCityList);
//        intent.putStringArrayListExtra("city_letters", (ArrayList)this.mCityLetterList);
//        intent.putExtra("city_map", (Serializable)this.mCityMap);
//        this.startActivityForResult(intent, 10);
//    }
//
//    private void gotoKeywordInputActivity() {
//        final Intent intent = new Intent((Context)this.getActivity(), (Class)KeywordListActivity.class);
//        intent.putExtra("cityCode", this.mCurrentCity);
//        intent.putExtra("tableID", this.tableID);
//        intent.putExtra("merchanttype", this.mMerchantType);
//        this.getActivity().startActivity(intent);
//    }
//
//    private void gotoMapActivity() {
//        final ArrayList<CloudItem> list = new ArrayList<CloudItem>();
//        for (int mFirstVisibleItem = this.mFirstVisibleItem; mFirstVisibleItem < this.mCoudItemList.size() && mFirstVisibleItem < this.mFirstVisibleItem + this.mCoudItemList.size(); ++mFirstVisibleItem) {
//            list.add(this.mCoudItemList.get(mFirstVisibleItem));
//        }
//        final double latitude = this.mCenterPoint.getLatitude();
//        final double longitude = this.mCenterPoint.getLongitude();
//        final Intent intent = new Intent((Context)this.getActivity(), (Class)MapActivity.class);
//        intent.putParcelableArrayListExtra("cloud_item_list", (ArrayList)list);
//        intent.putExtra("tableID", this.tableID);
//        intent.putExtra("latitude", latitude);
//        intent.putExtra("longitude", longitude);
//        intent.putExtra("merchantType", this.mMerchantType);
//        this.startActivity(intent);
//    }
//
//    private void initHead() {
//        this.titles = this.getResources().getStringArray(2131427328);
//        final View inflate = View.inflate((Context)this.getActivity(), 2130903211, (ViewGroup)null);
//        if (this.mPullRefreshListView.getRefreshableView().getHeaderViewsCount() < 1) {
//            this.mPullRefreshListView.getRefreshableView().addHeaderView(inflate);
//        }
//        this.initHeaderData(inflate);
//    }
//
//    private void initHeaderData(final View view) {
//        final ViewPager viewPager = (ViewPager)view.findViewById(2131100374);
//        this.dots_ll = (LinearLayout)view.findViewById(2131100375);
//        this.gridviewList = new ArrayList<GridView>();
//        this.stringList = Arrays.asList(this.getActivity().getResources().getStringArray(2131427328));
//        final List<Integer> initIconList = this.initIconList();
//        final int n = (int)Math.ceil(this.stringList.size() / 8.0);
//        for (int i = 0; i < n; ++i) {
//            final GridView gridView = new GridView((Context)this.getActivity());
//            gridView.setAdapter((ListAdapter)new PublicWelfareMercjamtHeadAdapter((Context)this.getActivity(), this.stringList, initIconList, i));
//            gridView.setNumColumns(4);
//            this.gridviewList.add(gridView);
//            gridView.setOnItemClickListener((AdapterView$OnItemClickListener)this);
//        }
//        viewPager.setAdapter(new MyViewPagerAdapter((Context)this.getActivity(), this.gridviewList));
//        viewPager.setOnPageChangeListener((ViewPager.OnPageChangeListener)new ViewPager.OnPageChangeListener() {
//            @Override
//            public void onPageScrollStateChanged(final int n) {
//            }
//
//            @Override
//            public void onPageScrolled(final int n, final float n2, final int n3) {
//            }
//
//            @Override
//            public void onPageSelected(final int n) {
//                PublicWelfareMerchantFragment.access$17(PublicWelfareMerchantFragment.this, n);
//                for (int i = 0; i < PublicWelfareMerchantFragment.this.dollList.size(); ++i) {
//                    if (i == n) {
//                        final LinearLayout$LayoutParams layoutParams = new LinearLayout$LayoutParams(BaseTools.dip2px((Context)PublicWelfareMerchantFragment.this.getActivity(), 6.0f), BaseTools.dip2px((Context)PublicWelfareMerchantFragment.this.getActivity(), 6.0f));
//                        layoutParams.setMargins(5, 0, 5, 0);
//                        ((View)PublicWelfareMerchantFragment.this.dollList.get(i)).setBackgroundResource(2130837787);
//                        PublicWelfareMerchantFragment.this.dollList.get(i).setLayoutParams((ViewGroup$LayoutParams)layoutParams);
//                    }
//                    else {
//                        final LinearLayout$LayoutParams layoutParams2 = new LinearLayout$LayoutParams(BaseTools.dip2px((Context)PublicWelfareMerchantFragment.this.getActivity(), 6.0f), BaseTools.dip2px((Context)PublicWelfareMerchantFragment.this.getActivity(), 6.0f));
//                        layoutParams2.setMargins(5, 0, 5, 0);
//                        ((View)PublicWelfareMerchantFragment.this.dollList.get(i)).setBackgroundResource(2130837603);
//                        PublicWelfareMerchantFragment.this.dollList.get(i).setLayoutParams((ViewGroup$LayoutParams)layoutParams2);
//                    }
//                }
//            }
//        });
//        this.firstDot(n);
//    }
//
//    private List<Integer> initIconList() {
//        final ArrayList<Integer> list = new ArrayList<Integer>();
//        list.add(2130837650);
//        list.add(2130837642);
//        list.add(2130837657);
//        list.add(2130837631);
//        list.add(2130837653);
//        list.add(2130837658);
//        list.add(2130837663);
//        list.add(2130837656);
//        list.add(2130837633);
//        list.add(2130837644);
//        list.add(2130837651);
//        list.add(2130837637);
//        list.add(2130837662);
//        list.add(2130837630);
//        list.add(2130837655);
//        list.add(2130837665);
//        list.add(2130837661);
//        list.add(2130837652);
//        list.add(2130837643);
//        list.add(2130837664);
//        list.add(2130837646);
//        list.add(2130837645);
//        list.add(2130837641);
//        list.add(2130837639);
//        return list;
//    }
//
//    private void initSelection(final View view, final int n) {
//        final RelativeLayout relativeLayout = (RelativeLayout)view.findViewById(2131099816);
//        final TextView textView = (TextView)view.findViewById(2131099819);
//        final ImageView imageView = (ImageView)view.findViewById(2131099820);
//        relativeLayout.setOnClickListener((View$OnClickListener)this);
//        if (n != 0) {
//            this.pop = new SelectPop(this.getActivity(), Arrays.asList(this.getActivity().getResources().getStringArray(n)), imageView, textView, false, new SelectPopCallback() {
//                @Override
//                public void onItemClick(final int n) {
//                    switch (PublicWelfareMerchantFragment.this.usertype) {
//                        case 1: {
//                            if (n == 0) {
//                                PublicWelfareMerchantFragment.access$11(PublicWelfareMerchantFragment.this, "");
//                                break;
//                            }
//                            if (n == 1) {
//                                PublicWelfareMerchantFragment.access$11(PublicWelfareMerchantFragment.this, "2");
//                                break;
//                            }
//                            if (n == 2) {
//                                PublicWelfareMerchantFragment.access$11(PublicWelfareMerchantFragment.this, "29");
//                                break;
//                            }
//                            break;
//                        }
//                        case 24:
//                        case 26: {
//                            if (n == 0) {
//                                PublicWelfareMerchantFragment.access$12(PublicWelfareMerchantFragment.this, "57ac21c7afdf520b894ed4d3");
//                                break;
//                            }
//                            if (n == 1) {
//                                PublicWelfareMerchantFragment.access$12(PublicWelfareMerchantFragment.this, "57ac2211afdf520b894ed76c");
//                                break;
//                            }
//                            break;
//                        }
//                    }
//                    PublicWelfareMerchantFragment.this.mPullRefreshListView.setHasMoreData(true);
//                    PublicWelfareMerchantFragment.this.mCoudItemList.clear();
//                    if (PublicWelfareMerchantFragment.this.localCity.equals(PublicWelfareMerchantFragment.this.mCurrentCity) && TextUtils.isEmpty((CharSequence)PublicWelfareMerchantFragment.this.mCurrentDistrict)) {
//                        PublicWelfareMerchantFragment.this.searchByArround(0);
//                        return;
//                    }
//                    PublicWelfareMerchantFragment.this.searchByLocal(0);
//                }
//            });
//            return;
//        }
//        if (this.usertype == 1) {
//            this.mMerchantType = "29";
//        }
//        relativeLayout.setVisibility(8);
//    }
//
//    private void initViewpager(final LinearLayout linearLayout) {
//        final RollViewPager rollViewPager = new RollViewPager((Context)this.getActivity(), this.dollList, (RollViewPager.OnPageClick)new RollViewPager.OnPageClick() {
//            @Override
//            public void onPageClick(final int n) {
//            }
//        });
//        this.firstDot(2);
//        final LinearLayout$LayoutParams linearLayout$LayoutParams = new LinearLayout$LayoutParams(-1, -2);
//        this.picUrlList.add(2130837746);
//        this.picUrlList.add(2130837794);
//        rollViewPager.setImageUrlList(this.picUrlList);
//        rollViewPager.startRoll();
//        linearLayout.removeAllViews();
//        linearLayout.addView((View)rollViewPager, (ViewGroup$LayoutParams)linearLayout$LayoutParams);
//    }
//
//    private void searchByArround(final int n) {
//        this.mCurrentSearchType = 2;
//        Label_0141: {
//            if (this.mCoudItemList != null && this.mCoudItemList.size() != 0) {
//                break Label_0141;
//            }
//            this.mCurrentPageNum = 0;
//            while (true) {
//                this.showProgressDialog("\u6570\u636e\u52a0\u8f7d\u4e2d...");
//                final SearchBound searchBound = new CloudSearch.SearchBound(new LatLonPoint(this.mCenterPoint.getLatitude(), this.mCenterPoint.getLongitude()), 10000);
//                try {
//                    this.mQuery = new CloudSearch.Query(this.tableID, this.mKeywords, searchBound);
//                    if (this.mMerchantType.equals("2")) {
//                        this.mQuery.addFilterString("merchantType", "2");
//                    }
//                    else if (this.mMerchantType.equals("29")) {
//                        this.mQuery.addFilterString("merchantType", "29");
//                    }
//                    this.mQuery.setPageSize(10);
//                    this.mQuery.setPageNum(n);
//                    this.mCloudSearch.searchCloudAsyn(this.mQuery);
//                    return;
//                    this.mCurrentPageNum = n;
//                }
//                catch (Exception ex) {
//                    ex.printStackTrace();
//                }
//            }
//        }
//    }
//
//    private void searchByLocal(final int mCurrentPageNum) {
//        this.mCurrentSearchType = 1;
//        while (true) {
//            while (true) {
//                Label_0027: {
//                    if (this.mCoudItemList == null || this.mCoudItemList.size() == 0) {
//                        this.mCurrentPageNum = 0;
//                        break Label_0027;
//                    }
//                    Label_0177: {
//                        break Label_0177;
//                        while (true) {
//                            String s = null;
//                            final CloudSearch.SearchBound searchBound = new CloudSearch.SearchBound(s);
//                            try {
//                                this.mQuery = new CloudSearch.Query(this.tableID, this.mKeywords, searchBound);
//                                if (this.mMerchantType.equals("2")) {
//                                    this.mQuery.addFilterString("merchantType", "2");
//                                }
//                                else if (this.mMerchantType.equals("29")) {
//                                    this.mQuery.addFilterString("merchantType", "29");
//                                }
//                                this.mQuery.setPageSize(10);
//                                this.mQuery.setPageNum(this.mCurrentPageNum);
//                                this.mCloudSearch.searchCloudAsyn(this.mQuery);
//                                return;
//                                s = this.getCurrentCity();
//                                continue;
//                                this.mCurrentPageNum = mCurrentPageNum;
//                                break;
//                            }
//                            catch (Exception ex) {
//                                ex.printStackTrace();
//                                return;
//                            }
//                        }
//                    }
//                }
//                this.showProgressDialog("\u6570\u636e\u52a0\u8f7d\u4e2d...");
//                if (this.mCurrentDistrict != null && !this.mCurrentDistrict.equals("") && !this.mCurrentDistrict.equals("\u5168\u57ce")) {
//                    final String s = String.valueOf(this.getCurrentCity()) + this.mCurrentDistrict;
//                    continue;
//                }
//                break;
//            }
//            continue;
//        }
//    }
//
//    private void searchDefault(final int n) {
//        this.mCurrentCity = this.getResources().getString(2131362193);
//        this.searchByLocal(n);
//    }
//
//    private void setCity(final City city) {
//        this.mChosenDistrictIndex = -1;
//        this.setCurrentCity(city.name.toString());
//        this.updatePopupWindowData();
//    }
//
//    private void setCurrentCity(String s) {
//        if (s == null) {
//            s = "\u672a\u80fd\u5b9a\u4f4d\u5f53\u524d\u57ce\u5e02";
//        }
//        final String replace = s.replace("\u5e02", "");
//        this.mCurrentCityDistrictTextview.setText((CharSequence)replace);
//        this.mCurrentCity = replace;
//    }
//
//    private void setLocation() {
//        (this.mLocationClient = new AMapLocationClient(this.mApplicationContext)).setLocationListener(this);
//        (this.mLocationOption = new AMapLocationClientOption()).setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
//        this.mLocationOption.setNeedAddress(true);
//        this.mLocationOption.setOnceLocation(false);
//        this.mLocationOption.setWifiActiveScan(true);
//        this.mLocationOption.setMockEnable(false);
//        this.mLocationOption.setInterval(2000L);
//        this.mLocationClient.setLocationOption(this.mLocationOption);
//        this.mLocationClient.startLocation();
//    }
//
//    private void setMapId(final View view) {
//        int n = 0;
//        this.usertype = ActivityManager.loginBean.usertype;
//        if (this.usertype == 1) {
//            this.tableID = "57105167305a2a6ea6690d7f";
//        }
//        else if (this.usertype == 24) {
//            this.tableID = "57ac21c7afdf520b894ed4d3";
//            n = 2131427361;
//        }
//        else if (this.usertype == 25) {
//            this.tableID = "57ac21c7afdf520b894ed4d3";
//            n = 0;
//        }
//        else {
//            final int usertype = this.usertype;
//            n = 0;
//            if (usertype == 26) {
//                this.tableID = "57ac2211afdf520b894ed76c";
//                n = 2131427362;
//            }
//        }
//        this.initSelection(view, n);
//    }
//
//    private void setPullLoad() {
//        this.mPullRefreshListView.setPullLoadEnabled(true);
//        this.mPullRefreshListView.setPullRefreshEnabled(true);
//        this.mPullRefreshListView.setOnRefreshListener((PullToRefreshBase.OnRefreshListener<ListView>)new PullToRefreshBase.OnRefreshListener<ListView>() {
//            @Override
//            public void onPullDownToRefresh(final PullToRefreshBase<ListView> pullToRefreshBase) {
//                PublicWelfareMerchantFragment.access$20(PublicWelfareMerchantFragment.this, 0);
//                PublicWelfareMerchantFragment.this.mPullRefreshListView.setHasMoreData(true);
//                PublicWelfareMerchantFragment.this.mPullRefreshListView.setPullLoadEnabled(true);
//                PublicWelfareMerchantFragment.access$21(PublicWelfareMerchantFragment.this, 2);
//                PublicWelfareMerchantFragment.this.searchByArround(0);
//            }
//
//            @Override
//            public void onPullUpToRefresh(final PullToRefreshBase<ListView> pullToRefreshBase) {
//                final PublicWelfareMerchantFragment this$0 = PublicWelfareMerchantFragment.this;
//                PublicWelfareMerchantFragment.access$20(this$0, 1 + this$0.mCurrentPageNum);
//                if (PublicWelfareMerchantFragment.this.mCurrentSearchType == 2) {
//                    PublicWelfareMerchantFragment.this.searchByArround(PublicWelfareMerchantFragment.this.mCurrentPageNum);
//                    return;
//                }
//                PublicWelfareMerchantFragment.this.searchByLocal(PublicWelfareMerchantFragment.this.mCurrentPageNum);
//            }
//        });
//    }
//
//    private void setUpInteractiveControls(final View view) {
//        this.mLLYNoData = (LinearLayout)view.findViewById(2131099822);
//        this.minputEditText = (EditText)view.findViewById(2131099817);
//        this.mSearchBarLinearLayout = (RelativeLayout)view.findViewById(2131099812);
//        this.mCurrentCityDistrictTextview = (TextView)view.findViewById(2131099814);
//        this.mUpDownArrow = (ImageView)view.findViewById(2131099815);
//        (this.mBtnAreaChoose = (LinearLayout)view.findViewById(2131099813)).setOnClickListener((View$OnClickListener)this);
//        (this.mBtnMap = (ImageView)view.findViewById(2131099818)).setOnClickListener((View$OnClickListener)this);
//        this.minputEditText.setOnClickListener((View$OnClickListener)this);
//        this.mPullRefreshListView = (PullToRefreshListView)view.findViewById(2131099821);
//        this.mPullRefreshListView.getRefreshableView().setDividerHeight(1);
//        this.setPullLoad();
//    }
//
//    private void showAreaPopupWindow() {
//        (this.mPopupWindow = new CityChoosePopupWindow((Context)this.getActivity(), this.mPopupWindowClickListener)).showAsDropDown((View)this.mSearchBarLinearLayout);
//        this.mUpDownArrow.setBackgroundResource(2130837509);
//        this.mPopupWindow.setOnDismissListener((PopupWindow$OnDismissListener)new PopupWindow$OnDismissListener() {
//            public void onDismiss() {
//                PublicWelfareMerchantFragment.this.mUpDownArrow.setBackgroundResource(2130837517);
//            }
//        });
//        if (this.mCityLetterList == null || this.mCityList == null || this.mCityMap == null) {
//            this.createCityListForCityChoose();
//        }
//        this.updatePopupWindowData();
//    }
//
//    private void showErrorDialog(final String s) {
//        final Dialog dialog = new Dialog((Context)this.getActivity());
//        dialog.setOnCancelListener((DialogInterface$OnCancelListener)new DialogInterface$OnCancelListener() {
//            public void onCancel(final DialogInterface dialogInterface) {
//            }
//        });
//        dialog.show();
//    }
//
//    private void showProgressDialog(final String s) {
//        (this.mProgressDialog = ToastUtils.createLoadingDialog((Context)this.getActivity(), s)).setCancelable(true);
//        this.mProgressDialog.show();
//    }
//
//    private void stopLocation() {
//        if (this.mLocationClient != null) {
//            this.mLocationClient.stopLocation();
//            this.mLocationClient.onDestroy();
//        }
//        this.mLocationClient = null;
//    }
//
//    private void updatePopupWindowData() {
//        this.mDistrictsOfCurrentCity = this.getDistrictsBasedonCityName(this.getCurrentCity());
//        this.mPopupWindow.getDistrictGridView().setAdapter((ListAdapter)new DistrictListAdapter((Context)this.getActivity(), this.mDistrictsOfCurrentCity, this.mChosenDistrictIndex));
//        this.mPopupWindow.getDistrictGridView().setOnItemClickListener(this.mGridViewItemListener);
//        this.mPopupWindow.getCurrentCityTextView().setText((CharSequence)this.getCurrentCity());
//        this.mCurrentCityDistrictTextview.setText((CharSequence)this.getCurrentCity());
//    }
//
//    public String getCurrentCity() {
//        return this.mCurrentCity;
//    }
//
//    @Override
//    public void onActivityResult(final int n, final int n2, final Intent intent) {
//        super.onActivityResult(n, n2, intent);
//        if (10 == n && n2 == 1001) {
//            final City city = (City)intent.getSerializableExtra("city_model");
//            if (city != null) {
//                this.setCity(city);
//            }
//            this.mCoudItemList.clear();
//            this.mAdapter.notifyDataSetChanged();
//            this.mCurrentDistrict = "";
//            this.searchByLocal(0);
//            return;
//        }
//        super.onActivityResult(n, n2, intent);
//    }
//
//    public void onClick(final View view) {
//        switch (view.getId()) {
//            default: {}
//            case 2131099813: {
//                this.showAreaPopupWindow();
//            }
//            case 2131099816: {
//                this.pop.showPop();
//            }
//            case 2131099818: {
//                this.gotoMapActivity();
//            }
//            case 2131099817: {
//                this.gotoKeywordInputActivity();
//            }
//        }
//    }
//
//    @Override
//    public void onCloudItemDetailSearched(final CloudItemDetail cloudItemDetail, final int n) {
//    }
//
//    @Override
//    public void onCloudSearched(final CloudResult cloudResult, final int n) {
//        if (!this.mKeywords.equals("")) {
//            this.mKeywords = "";
//        }
//        this.dissmissProgressDialog();
//        if (n == 0 && cloudResult != null) {
//            final ArrayList<CloudItem> clouds = cloudResult.getClouds();
//            if (clouds != null && clouds.size() >= 0) {
//                if (this.mCurrentPageNum == 0) {
//                    this.mCoudItemList.clear();
//                    this.mCoudItemList.addAll(clouds);
//                }
//                else {
//                    this.mCoudItemList.addAll(clouds);
//                }
//                this.mAdapter.tableID = this.tableID;
//                this.mAdapter.notifyDataSetChanged();
//            }
//            else {
//                this.mPullRefreshListView.setHasMoreData(false);
//                ToastUtils.showToast(this.mApplicationContext, this.getResources().getString(2131362183));
//            }
//        }
//        else if (n == 23) {
//            ToastUtils.showToastWithImage((Context)this.getActivity(), this.getResources().getString(2131362184), false);
//        }
//        else if (n == 27) {
//            ToastUtils.showToastWithImage((Context)this.getActivity(), this.getResources().getString(2131362179), false);
//        }
//        else if (n == 32) {
//            ToastUtils.showToastWithImage((Context)this.getActivity(), this.getResources().getString(2131362180), false);
//        }
//        else if (n == 33) {
//            ToastUtils.showToastWithImage((Context)this.getActivity(), this.getResources().getString(2131362185), false);
//        }
//        else if (n == 34) {
//            ToastUtils.showToastWithImage((Context)this.getActivity(), this.getResources().getString(2131362186), false);
//        }
//        if (this.mCoudItemList == null || this.mCoudItemList.size() == 0) {
//            this.mLLYNoData.setVisibility(0);
//        }
//        else {
//            this.mLLYNoData.setVisibility(8);
//        }
//        this.mPullRefreshListView.onpull_refresh_listPullDownRefreshComplete();
//        this.mPullRefreshListView.onPullUpRefreshComplete();
//    }
//
//    @Override
//    public View onCreateView(final LayoutInflater layoutInflater, final ViewGroup viewGroup, final Bundle bundle) {
//        return layoutInflater.inflate(2130903065, (ViewGroup)null);
//    }
//
//    public void onItemClick(final AdapterView<?> adapterView, final View view, final int n, final long n2) {
//        final String s = this.stringList.get(n + 8 * this.currentPage);
//        final Intent intent = new Intent((Context)this.getActivity(), (Class)SearchByKeywordActivity.class);
//        intent.putExtra("keyWord", s);
//        intent.putExtra("cityCode", this.mCurrentCity);
//        intent.putExtra("tableID", this.tableID);
//        intent.putExtra("merchantType", this.mMerchantType);
//        this.startActivity(intent);
//    }
//
//    @Override
//    public void onLocationChanged(final AMapLocation aMapLocation) {
//        this.dissmissProgressDialog();
//        this.stopLocation();
//        if (aMapLocation == null) {
//            this.searchDefault(0);
//            return;
//        }
//        if (aMapLocation.getErrorCode() == 0) {
//            this.mCenterPoint = new LatLonPoint(Double.valueOf(aMapLocation.getLatitude()), Double.valueOf(aMapLocation.getLongitude()));
//            this.localCity = aMapLocation.getCity().replace("\u5e02", "");
//            this.setCurrentCity(aMapLocation.getCity());
//            this.mCurrentSearchType = 2;
//            this.searchByArround(0);
//            return;
//        }
//        ToastUtils.showToast((Context)this.getActivity(), this.getResources().getString(2131362196));
//        this.searchDefault(0);
//    }
//
//    @Override
//    public void onPause() {
//        super.onPause();
//        this.stopLocation();
//    }
//
//    @Override
//    public void onViewCreated(final View view, final Bundle bundle) {
//        super.onViewCreated(view, bundle);
//        this.mApplicationContext = this.getActivity().getApplicationContext();
//        this.setMapId(view);
//        (this.mCloudSearch = new CloudSearch((Context)this.getActivity())).setOnCloudSearchListener((CloudSearch.OnCloudSearchListener)this);
//        this.showProgressDialog("\u5b9a\u4f4d\u4e2d...");
//        this.setLocation();
//        this.setUpInteractiveControls(view);
//        this.mCurrentCity = this.getResources().getString(2131362193);
//        this.initHead();
//        this.mAdapter = new CloudItemListAdapter(this.mApplicationContext, this.mCoudItemList, this.tableID);
//        this.mPullRefreshListView.getRefreshableView().setAdapter((ListAdapter)this.mAdapter);
//    }
}
